<p class="Paragraph"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">VarName:</span> Any variable or array name.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Start, End:</span> Numerical values or constants ranging from -32768 to 32767 that define the number of elements (NumberElements=(end-start)+1) and the index range.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/>Start and End can be numeric expressions if ReDim is used at the procedure level.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">VarType:</span> Key word that declares the data type of a variable.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Object:</span> Object variable (can only be subsequently defined by Set!)</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="17" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">[Single]:</span> Single floating-point variable (3.402823 x 10E38 - 1.401298 x 10E-45). If no key word is specified, a variable is defined as Single, unless a statement from DefBool to DefVar is used.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">String:</span> String variable containing a maximum of 64,000 ASCII characters.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="19" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Variant: </span>Variant variable type (can contain all types and is set by definition).</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/>In <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Basic, you do not need to declare variables explicitly. However, you need to declare an array before you can use them. You can declare a variable with the Dim statement, using commas to separate multiple declarations. To declare a variable type, enter a type-declaration character following the name or use a corresponding key word.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/><help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic supports single or multi-dimensional arrays that are defined by a specified variable type. Arrays are suitable if the program contains lists or tables that you want to edit. The advantage of arrays is that it is possible to address individual elements according to indexes, which can be formulated as numeric expressions or variables.</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="22" xmlns:help="http://openoffice.org/2000/help"/>There are two ways to set the range of indices for arrays declared with the Dim statement:</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="23" xmlns:help="http://openoffice.org/2000/help"/>DIM text(20) As String <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>REM 21 elements numbered from 0 to 20</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/>DIM text(5 to 25) As String REM 21 elements numbered from 5 to 25</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/>DIM text$(-15 to 5) As String REM 21 elements (0 inclusive),</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/>rem numbered from -15 to 5</p>
<p class="Paragraph"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/>Variable fields, regardless of type, can be made dynamic if they are dimensioned by ReDim at the procedure level in subroutines or functions). Normally, you can only set the range of an array once and you cannot <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>modify it. Within a procedure, you can declare an array using the ReDim statement with numeric expressions to define the range of the field sizes.</p>